EV Report

Electric Vehicles (EVs) are revolutionizing the transportation industry by offering an environmentally-friendly alternative to traditional gasoline-powered vehicles. As EVs become more mainstream, understanding the trends and challenges of EV adoption and charging infrastructure is crucial for policymakers, researchers, and EV enthusiasts alike. In this report, we present a comprehensive analysis of new EV sales in California by city and county, featuring interactive graphs that show new EV sales data standardized by the number of cars in those respective cities and counties. We also provide detailed information on EV chargers in each city, including a map of public charger locations, and highlight the federal electric bus program, which is driving the transition to zero-emission buses. All of the data used in this report is sourced from publicly available datasets, ensuring transparency and accountability. Whether you are a policy maker looking to advance sustainable transportation policies, a researcher seeking to understand the latest trends in EV adoption, or an EV enthusiast wanting to stay informed about charging infrastructure, this report is an essential read. Join us on this journey as we explore the latest developments in the EV landscape and the opportunities and challenges that lie ahead.

In addition to new EV sales and charging infrastructure data, this report also includes graphs on key factors related to the EV landscape. This includes the average cost of ownership, battery material sourcing, car fires, and well-to-wheel emissions. By providing a comprehensive analysis of these factors, the report offers a holistic view of the EV landscape in California and empowers readers to make informed decisions about the future of sustainable transportation.

Contra Costa County City Rankings

# this is a stacked bar graph of standardized 2022 zEV sales and Chargers per car on road, with bonus points given to brentwood for the bus program
#This is a standardized ZEV sales for each city in the county
#This is a standardized charging stations by car on road for each city in the county

2022 ZEV sales by County

Where Does your County Stack up?

zev_sales_one_value <- zev_sales_county %>% 
  pivot_wider(names_from = c(fuel_type, make, model), values_from = number_of_vehicles) %>% 
  filter(data_year == 2022) %>%
  mutate(Total_Sales = rowSums(select(., -c(data_year, county)), na.rm = TRUE))

####

url <- 'https://raw.githubusercontent.com/plotly/datasets/master/geojson-counties-fips.json'
counties <- rjson::fromJSON(file=url)

### add fips to data

urlmap <- "https://raw.githubusercontent.com/kjhealy/fips-codes/master/state_and_county_fips_master.csv"

county_fips_map <- read.csv(urlmap, colClasses=c(fips="character")) %>%
  filter(state == "CA") %>% 
  rename(county = name) %>% 
  mutate(county = ifelse(str_detect(county, " County"), str_replace(county, " County", ""), county))

join_county_fips <- left_join(zev_sales_one_value, county_fips_map, by= "county") %>% 
  drop_na(fips) %>% #out of state
  mutate_at(vars(Total_Sales), as.numeric) %>% 
  #this was really annoying 
  mutate(fips = stringr::str_pad(fips, width = 5, pad = "0")) %>% 
  mutate_at(vars(fips), as.character)%>% 
  mutate_all(~ifelse(is.na(.), 0, .))


### need to check matching--------------------------
g <- list(
  fitbounds = "locations",
  visible = FALSE
)
fig <- plot_ly()
fig <- fig %>% add_trace(
  type="choropleth",
  geojson=counties,
  locations=join_county_fips$fips,
  z=join_county_fips$Total_Sales,
  colorscale="Blues",
  marker=list(line=list(
    width=0)
  )
)
fig <- fig %>% colorbar(title = "Total EV an PHEV Sales")
fig <- fig %>% layout(
  title = "Total EV an PHEV Sales by County"
)

fig <- fig %>% layout(
  geo = g
)

fig

Data Description and Citation

The data used in this analysis includes the following:

When using this data, please cite the following sources:

If you have any questions or comments about this report or the data sources used, please feel free to reach out to the author at .

Note that if include=FALSE, all of the code, results, and figures will be suppressed. If include=TRUE and results=“hide”, the results will be hidden but figures will still be shown. To hide the figures, use fig.show=“hide”.